﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--BEGIN CHECKBOX-->
    <Style x:Key="CheckRadioFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="15,0,0,0" SnapsToDevicePixels="true"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="FontFamily" Value="Tahoma"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="Foreground" Value="{DynamicResource BrushCheckBoxForeground}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Width" Value="100"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <BulletDecorator SnapsToDevicePixels="true" Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Grid>
                                <Border Height="21" Width="21" Padding="2">
                                    <Border x:Name="Border" BorderBrush="{DynamicResource BrushCheckBoxBorder}" BorderThickness="1" Background="{DynamicResource BrushCheckBoxBackground}" Width="13" Height="13" CornerRadius="2">
                                        <Grid>
                                            <Path x:Name="Path" Width="10.989" Height="10.997" Stretch="Fill" StrokeThickness="1.7" HorizontalAlignment="Right" VerticalAlignment="Top" Data="{DynamicResource IconCheckBoxFillHover}" Stroke="{DynamicResource BrushCheckBoxBackgroundHover}" Visibility="Collapsed"/>
                                            <Rectangle x:Name="IndeterminateHover" StrokeThickness="0" Height="13" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Width="13" HorizontalAlignment="Right" Visibility="Collapsed" Fill="{DynamicResource BrushCheckBoxIndeterminateHover}"/>
                                            <Rectangle x:Name="Indeterminate" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Bottom" Width="6.696" Height="6.695" Stroke="{x:Null}" Fill="{DynamicResource BrushCheckoxIndeterminate}" RadiusX="2" RadiusY="2"/>
                                            <Path x:Name="CheckMark" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="7.3" Height="7" Margin="1.875,2,0,0" Data="{DynamicResource IconCheckBoxChecked}" Fill="{DynamicResource BrushCheckBoxCheckMarkFill}"/>
                                        </Grid>
                                    </Border>
                                </Border>
                                <Rectangle x:Name="RectangleBullet" Stroke="{DynamicResource BrushCheckBoxBorderFocused}" StrokeDashArray="2 2" StrokeThickness="1" SnapsToDevicePixels="true" Height="17" Width="17" VerticalAlignment="Center" Visibility="Collapsed"/>
                            </Grid>
                        </BulletDecorator.Bullet>
                        <Grid Height="21">
                            <Rectangle x:Name="RectangleContent" Stroke="{DynamicResource BrushCheckBoxBorderFocused}" StrokeDashArray="2 2" StrokeThickness="1" Margin="3" SnapsToDevicePixels="true" Height="16" VerticalAlignment="Center" Visibility="Collapsed"/>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="5,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
                        </Grid>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True"/>
                                <Condition Property="IsMouseCaptured" Value="False"/>
                                <Condition Property="IsChecked" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="Path"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True"/>
                                <Condition Property="IsMouseCaptured" Value="False"/>
                                <Condition Property="IsChecked" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="Path"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True"/>
                                <Condition Property="IsMouseCaptured" Value="False"/>
                                <Condition Property="IsChecked" Value="{x:Null}"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="IndeterminateHover"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsFocused" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="RectangleContent"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsFocused" Value="True"/>
                                <Condition Property="Content" Value=""/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="RectangleContent"/>
                            <Setter Property="Visibility" Value="Visible" TargetName="RectangleBullet"/>
                        </MultiTrigger>
                        <Trigger Property="IsMouseCaptured" Value="True">
                            <Setter Property="Background" Value="{DynamicResource BrushCheckBoxBackgroundPressed}" TargetName="Border"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Indeterminate"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Indeterminate"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource BrushCheckBoxForegroundDisabled}"/>
                            <Setter Property="BorderBrush" Value="{DynamicResource BrushCheckBoxBorderDisabled}" TargetName="Border"/>
                            <Setter Property="Background" Value="{DynamicResource BrushCheckBoxBackgroundDisabled}" TargetName="Border"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushCheckBoxCheckMarkFillDisabled}" TargetName="CheckMark"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushCheckBoxIndeterminateDisabled}" TargetName="Indeterminate"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END CHECKBOX-->
</ResourceDictionary>